import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:flutter_food_ordering_web/model/cart_model.dart';
import 'package:flutter_food_ordering_web/page/checkout_page.dart';
import 'package:flutter_food_ordering_web/page/login_page.dart';
import 'package:flutter_food_ordering_web/page/store_page.dart';
import 'package:flutter_food_ordering_web/res/colors.dart';
import 'package:flutter_food_ordering_web/routers/application.dart';
import 'package:flutter_food_ordering_web/routers/routers.dart';
import 'package:provider/provider.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  
  MyApp() {
    final router = Router();
    Routes.configureRoutes(router);
    Application.router = router;
  }

  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider(
      builder: (context) => Cart(),
      child: MaterialApp(
        title: '乐歌订餐系统',
        debugShowCheckedModeBanner: false,
        theme: ThemeData(
          // This is the theme of your application.
          //
          // Try running your application with "flutter run". You'll see the
          // application has a blue toolbar. Then, without quitting the app, try
          // changing the primarySwatch below to Colors.green and then invoke
          // "hot reload" (press "r" in the console where you ran "flutter run",
          // or simply save your changes to "hot reload" in a Flutter IDE).
          // Notice that the counter didn't reset back to zero; the application
          // is not restarted.
          primaryColor: Colours.app_main,
          textTheme: Theme.of(context).textTheme.apply(
            fontFamily: 'Open Sans'
          )
        ),
        home: LoginPage(),
      ), 
    );
  }
}